from shared_data.mock_data import BasicFaker, return_response
from app.core import MockResponseType
from shared_data.robot import DISCOVER_FLEX_EXAMPLE


class FlexCommunication(BasicFaker):
    def __init__(self):
        super().__init__()

    @return_response(detail="Get date fail")
    async def get_date(self, _mock_type: MockResponseType):
        return {"date": str(self.date_time())}

    @return_response(detail="Update date fail")
    async def update_date(self, _mock_type: MockResponseType):
        return {
            "old_date": str(self.date_time()),
            "new_date": str(self.date_time())
        }

    @return_response(detail="Recover date fail")
    async def recover_date(self, _mock_type: MockResponseType):
        return {}

    @return_response(detail="Discover flex fail")
    async def discover_flex(self, _mock_type: MockResponseType):
        return DISCOVER_FLEX_EXAMPLE